const Koa = require('koa')
import conf from './config'
import middleware from './middleware'
import router from './routes'
import ip from 'ip'
import './mongo'

const app = new Koa()
middleware(app)
router(app)
app.listen(conf.port, () => {
    console.log(`✅  The server is running at http://${ip.address()}:${conf.port}${conf.baseApi}`)
})

module.exports = app
